﻿/************************************************************************
*	@description 	Abstração para botões customizáveis de input file.
*	@authors		Eduardo Ottaviani <eduardo.aragao@agenciaclick.com.br>
*	@version		1.0
*	@date			2008-10-21
*	@example		<div class="fakefile">
						<input type="file" class="file" alt="Procurar" /><input readonly="true" class="text fake"/>
						<img src="http://blogwindows.files.wordpress.com/2007/04/search_icon.png" />
					</div>

	
	@js:
		function(){
			var el = []
			var aux = document.getElementsByTagName('*')
				for(var x=0; x<aux.length; x++)
					if(aux[x].className && aux[x].className=="fakefile")
						el.push(aux[x])
				for(var x=0; x<el.length; x++)
					if(
						el[x].getElementsByTagName('input')[0].type && 
						el[x].getElementsByTagName('input')[0].type == "file"
					)
						
						el[x].getElementsByTagName('input')[0].onchange = function(){
							this.nextSibling.value = this.value							
						}
		}
	@jQuery: 
		$('.fakefile :file').change(function(){ $( this ). next().val( this.value ) }) 		
*/
	
	.fakefile{
		position:relative;
		text-align:right;
		overflow:hidden;		
		float:left;
		display:inline
	}
	
		.fakefile input.fake{ 
			position:relative; 		
			z-index:2
		}
		.fakefile input.file { 
			position:absolute;
			right:0;		
			top:10px;
			filter:alpha(opacity=0);
			opacity:0
		}
	
	/* Alterações a partir daqui:*/
	.fakefile input.fake{ 
		top:-16px; 
		width:160px
	}	